<?php
include "connect.php";
$name		=$_REQUEST['name'];
$password	=$_REQUEST['password'];
$ins = "select count(*) from user where name='{$name}' and password='{$password}'";
$result = mysql_query($ins, $dbLink);
$row = mysql_fetch_row($result);
$count = $row[0];
if ($count > 0)
{
setcookie("user", $name."|".md5($password), time()+3600);
echo "<script>window.location='list.php';</script>";
}
else
{
echo "<script>alert('不是会员，请注册用户！');</script>";
echo "<script>window.location='login.php';</script>";
}
?>
